home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / INSTALL.MAC < prev    next >
Text File  |  1993-03-16  |  15KB  |  291 lines

  1.                 Macintosh NetHack 3.0 Installation Guide
  2.                 ========================================
  3.                 last modification date: May 28th, 1990
  4.  
  5. (Original credit for porting NetHack 3.0 to the Macintosh goes to Johnny
  6. Lee and Michael Sokolov. David Hairston, Kevin Sitze, Andy Swanson, Jon
  7. Watte and Tom West helped polish this port in later versions.)
  8.  
  9. 0.  Some notes before getting started. These instructions work for the
  10.     Think C 4.0 compiler. Other Macintosh compilers should be okay (i.e.
  11.     Lightspeed C 3.0 and Manx Aztec C), however some work may be needed
  12.     to complete the build. For other compilers you can use the various
  13.     Makefiles and your compiler errors as guides in building the game.
  14.  
  15.     You should maintain the file/folder structure given in the distri-
  16.     bution file "Files". These notes assume the file structure listed
  17.     below. Place the "top" folder appropriately in your compilers
  18.     development folder. You'll need ~6M disk space for development.
  19.     top:
  20.       Files
  21.       Install.mac
  22.       Makefile.top
  23.       auxil:    (... all files) {auxiliary support files}
  24.       include:  (... all files) {header files}
  25.       mac:      (... all files) {Macintosh specific files}
  26.       others:   (pcconf.c, pcmain.c, pctty.c & random.c only)
  27.       src:      (... all files) {generic source files}
  28.  
  29.     Now is a good time to decode the *.hqx files (mac folder), creating
  30.     3 Think C 4.0 project files and 2 associated resource files. You may
  31.     use BinHex 4.0 or Stuffit 1.5.1 for this. These 5 files (*.proj and
  32.     *.rsrc) should be moved from the mac folder into the "top" folder.
  33.  
  34.     Use your favorite text editor to create an empty file of type "TEXT".
  35.     This file should be called "news" and should be placed in the auxil
  36.     folder. If you decide to use the news feature of NetHack you can
  37.     write an appropriate starting message in this file.
  38.  
  39.     Create a folder called "dungeon" in your "top" folder. This is where
  40.     we'll copy the final files needed to run NetHack.
  41.  
  42.     Finally, you should have no problem compiling the NetHack sources, as
  43.     distributed. However, if you intend to make changes to the sources you
  44.     should consider backing up your disk to prevent problems. Also, trash
  45.     (or perhaps alter the creator signature of) your old versions of NetHack
  46.     3.0 to avoid conflicts.
  47.  
  48.     Okay, let's get started. We're going to make 3 applications, in order:
  49.     (1) makedefs, to create customized files for the game, (2) spec_lev,
  50.     to create special challenging maze-like levels and (3) nethack! The
  51.     full build from scratch takes less than an hour using Think C 4.0 .
  52.  
  53. 1a. Make sure all the NetHack files are in the appropriate folder structure.
  54.     You should have a top folder with subfolders auxil, include, mac, others,
  55.     and src. The provided Think C 4.0 projects assume this structure (as do
  56.     the provided Makefiles).
  57.  
  58. 1b. If your compiler doesn't handle subfolders you'll need to place all the
  59.     inter-related source (*.c) and header (*.h) files in a common folder. It
  60.     may require some work but you should be able to follow the dependencies
  61.     in the Makefiles to build the game.
  62.  
  63. 2.  If your compiler utilizes the make/Makefile facilities, you'll need to
  64.     remove the tags from the Makefiles (auxil, src and top) and edit them
  65.     appropriately. The Makefiles are not needed if you can use the provided
  66.     Think C 4.0 project files.
  67.  
  68. 3.  Edit the config.h file making the following changes to configure it
  69.     properly for the Macintosh:
  70.  
  71.     Section 1. OS Selection.
  72.     Comment out: #define UNIX
  73.     Uncomment  : #define MACOS (bottom of the ifdef __MSDOS__ else clause).
  74.  
  75.     Within the #ifdef MACOS segment configure the #define's to choose your
  76.     compiler. The default is to use THINKC4. For now, skip the other
  77.     #define's there. Note that if your compiler is LSC or AZTEC, the KR1ED
  78.     compiler directive is automatically defined for you. This directive
  79.     allows these compilers to use the defined() construct. Additionally,
  80.     for the LSC a/o AZTEC compilers you'll also need to add the line:
  81.     #define defined(x) (-x-1 != -1)
  82.     before the first occurrence of #if defined(x) in random.c and mon.c!
  83.  
  84.     Section 2. Some global parameters and filenames.
  85.     For THINKC4 define the WIZARD name. A good choice is "debug" since
  86.     that is the purpose of this option. For LSC or AZTEC define the
  87.     WIZARD_NAME appropriately. This is the name that needs to appear in
  88.     your "NetHack Prefs" file (system folder) in order to use Wizard
  89.     (Debug) mode.
  90.  
  91.     Comment out: #define LOGFILE "logfile"
  92.  
  93.     Section 3. Definitions that may vary with system type.
  94.     The defaults are all okay here for THINKC4, LSC and AZTEC.
  95.      
  96.     Section 4. THE FUN STUFF!!!
  97.     uncomment:   #define SCORE_ON_BOTL  (This is optional. It will allow
  98.     you to see your current score on the bottom line during play.)
  99.     The rest of the #define's default to configuring a "full-featured"
  100.     NetHack game.
  101.  
  102.     Save the config.h file.
  103.  
  104.     If you intend to customize the game you will want to look at the files
  105.     macconf.h and system.h. This typically isn't needed for simply building
  106.     the game.
  107.  
  108. 4.  Now we're going to build the makedefs application. This application
  109.     depends on various header files and the source files:
  110.     alloc.c  macfile.c  makedefs.c  monst.c  objects.c  & panic.c .
  111.     If necessary look at the Makefile(.src) to determine the dependencies.
  112.     You'll need to load the libraries appropriate for your compiler. THINKC4
  113.     users can simply open the "makedefs.proj" file.
  114.  
  115.     Re-edit the config.h file! Go to the #ifdef MACOS segment in section 1.
  116.     Comment out: #define CUSTOM_IO .
  117.     Uncomment  : #define MAKEDEFS_C .
  118.  
  119.     Close the config.h file, saving the changes.
  120.  
  121.     Build the makedefs application. The Think C 4.0 project uses resources
  122.     from the "makedefs.proj.rsrc" file. Save the application in the "top"
  123.     folder. Close the project. Run the makedefs application, sequentially
  124.     choosing all seven options. This will require re-launching each time.
  125.     You've now created additional auxiliary files for the game and added
  126.     icons and signatures to these 12 files (auxil folder): cmdhelp, data,
  127.     help, hh, history, license, MacHelp, news, opthelp, oracles, record,
  128.     and rumors. These files can now be copied into the dungeon folder.
  129.  
  130.     If you decide to change features in the game, remember to always
  131.     rebuild makedefs first to setup the needed data structures and so on
  132.     for the game.
  133.  
  134. 5.  Next, we're going to build the spec_lev application. This application
  135.     depends on various header files and the source files:
  136.     alloc.c  lev_comp.c  lev_lex.c  lev_main.c  macfile.c  monst.c
  137.     objects.c  & panic.c
  138.     If you copied the alternate file lev_lex.c in the "others" folder, you
  139.     should remove (or rename) it to avoid problems with src:lev_lex.c. The
  140.     dependencies here are similar to the ones for the makedefs project.
  141.     Again, if necessary, refer to the Makefile(.src) for help. You should
  142.     need the same libraries for this application as you did for makedefs.
  143.     THINKC4 users can simply open the "spec_lev.proj" file.
  144.  
  145.     The changes needed to build this application are more complicated than
  146.     before, however the checklist provided below should cover all the bases.
  147.  
  148.    *Edit config.h (Section 1. within the #ifdef MACOS segment)
  149.     Comment out: #define MAKEDEFS_C
  150.     Comment out: #define NEED_VARARGS  {more on pre-compiled headers later}
  151.     Save the changes to config.h and close the file.
  152.  
  153.    *Edit lev_lex.c. These changes will appear sequentially:
  154.     Find                                    Replace with
  155.     {... near the beginning ...}
  156.     int yyleng; extern char yytext[];       int yyleng; extern char *yytext;
  157.     int yymorfg;                            int yymorfg;
  158.     extern char *yysptr, yysbuf[];          extern char *yysptr, *yysbuf;
  159.     int yytchar;                            int yytchar;
  160.     FILE *yyin ={stdin}, *yyout ={stdout};  FILE *yyin =stdin, *yyout =stdout;
  161.     {... near the end ...}
  162.     {... If you're using LSC or THINKC4 comment out: ...}
  163.     {... #define NLSTATE yyprevious=YYNEWLINE ...}
  164.     char yytext[YYLMAX];                    char *yytext;
  165.     {... Skip a line ...}
  166.     char yysbuf[YYLMAX];                    char *yysbuf;
  167.     char *yysptr = yysbuf;                  char *yysptr;
  168.     Save the changes to lev_lex.c and close the file.
  169.  
  170.    *Edit lev_comp.c near the middle of the file.
  171.     Find                                    Replace with
  172.     #endif not lint                         #endif /* not lint */
  173.     Save the change to lev_comp.c and close the file.
  174.  
  175.    *Edit lev_main.c near the beginning of the file.
  176.     Uncomment:   #include "hack.h"
  177.     Save the change to lev_main.c and close the file.
  178.  
  179.     Build the spec_lev application and save it into the "top" folder.
  180.     Close the spec_lev project. Now run the spec_lev application, it
  181.     will show you what file it is currently working on and create the
  182.     5 special levels: castle, endgame, tower1, tower2 and tower3 in
  183.     the top folder. These 5 files should be moved into the dungeon
  184.     folder.
  185.  
  186.     If you're really motivated and want to create customized special
  187.     levels it should be possible to modify the special level compiler
  188.     to accomodate your efforts. You'll also want to edit the "descrip[]"
  189.     and "argc" variables, appropriately in lev_main.c within the ifdef
  190.     MACOS segments, to get the compiler to recognize your custom levels.
  191.     This is not trivial! You probably won't bother (no one has)!
  192.  
  193.     If you decide to change features in the game, remember to rebuild
  194.     the special levels compiler to reflect those changes and also
  195.     recreate the special levels.
  196.  
  197. 6.  This is what you've been waiting for! Now we're going to build the
  198.     game. The file "Segments.mac" shows the source dependencies for this
  199.     application and suggests a workable scheme for creating properly sized
  200.     segments. THINKC4 users can simply open the "nethack.proj" file, other
  201.     users should build segments according to "Segments.mac" and also add
  202.     in the appropriate libraries.
  203.  
  204.     Follow the checklist below which indicates the changes needed to build
  205.     the game.
  206.  
  207.    *Edit topten.c near the beginning and set the following values:
  208.     #define POINTSMIN 51
  209.     #define ENTRYMAX 50
  210.     comment out: #define PERS_IS_UID
  211.     This will keep the size of the record file reasonable. Save your
  212.     changes and close topten.c .
  213.  
  214.    *Edit config.h within the #ifdef MACOS segment:
  215.     uncomment:   #define CUSTOM_IO
  216.     uncomment:   #define NEED_VARARGS
  217.     Save your changes to config.h and close the file.
  218.  
  219.     Since we're going to use pre-compiled headers in our THINKC4 project
  220.     a minor lexical change needs to be made to several files. The
  221.     affected files are:
  222.     alloc.c     apply.c     end.c       extralev.c  mkroom.c    monmove.c
  223.     pager.c     pctty.c     pri.c       priest.c    save.c      shk.c
  224.     sounds.c    termcap.c   topl.c      topten.c
  225.     In these files we'll need to comment out the #define's that appear
  226.     before the first #include compiler directive. Usually this only
  227.     involves a single #define (end.c, monmove.c and topten.c are exceptions).
  228.     This can be done fairly easily using the regular expression search
  229.     feature of the "Find" command. Assuming that all files are in the project
  230.     invoke the "Find" command from the "Search" menu. Enter these fields:
  231.     Search For:                            Replace with:
  232.     ^\(#.*pre-compiled headers \*\/\)      /*\1
  233.     Check the "Grep" and "Multi-File Search" check boxes (you'll be
  234.     looking in all .c files) then click the "Don't Find" button.
  235.     Now repeat this sequence:
  236.     1) Select "Find in Next File" from the "Search" menu.
  237.     2) When it finally makes a match, Select "Replace All".
  238.     3) Click the "Okay" button in the ensuing alert and go back to (1),
  239.     until there are no more matches. Save the changes to these files
  240.     and close them all (you may consider doing 6 at a time if having
  241.     too many open windows is a problem).
  242.  
  243.     Copy the files hack.h and config.h to oldhack.h. and oldconfig.h,
  244.     respectively. You'll need the old*.h files (properly renamed) if you
  245.     make changes to the game and need to rebuild the makedefs and spec_lev
  246.     applications. Trash the hack.h file and "Open" the "oldhack.h" file
  247.     for editing. Select "Precompile ..." fom the "Source menu and save the
  248.     result as "hack.h". Close the oldhack.h file. Now trash the "config.h"
  249.     file and "Open" the "oldconfig.h" file for editing. Again select
  250.     "Precompile ..." and save the result as "config.h". Close the file
  251.     oldconfig.h . Make sure that you aren't auto-including "MacHeaders"
  252.     by selecting the "Options ..." entry from the "Edit" menu. Click the
  253.     "Code Generation" radio button and make sure that "<MacHeaders>" is
  254.     not checked.
  255.  
  256.     Build the application, this make take a few minutes. Save the game
  257.     into the dungeon folder. Close the nethack project and you're ready
  258.     to play the game (I hope all went well).
  259.  
  260. Special Note: If you are attempting to build Nethack 3.0 on a 1M Macintosh
  261.     using Think C 4.0, then memory may be a problem. It is suggested that
  262.     you turn off debugging info for monst.c and objects.c . Also, if for
  263.     some reason, compilation stops in the segment containing these two
  264.     files after they have been compiled, then you should drag these two
  265.     files into a separate segment, finish compiling the files of the
  266.     original segment and then restore these two files to the original
  267.     segment. Alternatively, you may decide to "Kompile" monst.c and
  268.     objects.c separately while preserving the given segmentation scheme.
  269.  
  270. 7.  Cleanup. It's a good idea to always rebuild the makedefs and spec_lev
  271.     applications from scratch. Therefore you can trash these applications
  272.     and also remove the objects from their respective projects (Think C
  273.     compilers) to conserve disk space. The same can be done for your
  274.     nethack project. Consider the changes outlined above and undo them
  275.     as needed to rebuild the project, if you decide to modify the game.
  276.     If you're satisfied with the "full-featured" game you can trash all
  277.     the files for a real saving!
  278.  
  279. Notes:
  280. 1.  You should trash bones and save files from previous versions since
  281.     they will not work with this version. Record files will work but
  282.     notice that new scores will have a different format. It is easiest
  283.     to just start fresh with a new scoreboard (record file).
  284.  
  285. 2.  If you can afford the RAM space you might consider giving the game
  286.     a 1M partition in Multifinder instead of the default 750k.
  287.  
  288.     We, the members of the Macintosh NetHack Development Team, hope you
  289.     enjoy the game. We've worked hard at porting and polishing it to
  290.     make it behave in the Macintosh way!
  291.